package work.topo;

public class UniDirectionRingProcessTopologyImpl implements UniDirectionRingProcessTopology {
	private int me;
	private int size;
	
	public UniDirectionRingProcessTopologyImpl(int me, int size) {
		this.me = me;
		this.size = size;
	}

	public int me() {
		return me;
	}
	public int size() {
		return size;
	}
	public int getSendTarget() {
		return (me+1)%size;
	}
	public int getRecvTarget() {
		return ((me-1)<0?size-1:me-1);
	}
}
